#include "xmppim/roster.h"

namespace yoohoo_xmppim {

RosterItem::RosterItem(const QString& jid, const QString& name, const QList<QString>& groups,
		const RosterItem::SubscriptionState& subscription, const QString& ask) : _jid(jid),
			_subscription(subscription), _ask(ask), _name(name), _groups(groups) {
}

bool RosterItem::operator==(const RosterItem& other) const {
	return _jid == other._jid;
}


const QString& RosterItem::jid() {
	return _jid;
}

const RosterItem::SubscriptionState& RosterItem::subscription() {
	return _subscription;
}

const QString& RosterItem::name() {
	return _name;
}

const QList<QString>& RosterItem::groups() {
	return _groups;
}

const QString& RosterItem::ask() {
	return _ask;
}

void RosterItem::setJid(const QString& jid) {
	_jid = jid;
}

void RosterItem::setName(const QString& name) {
	_name = name;
}

void RosterItem::setGroups(const QList<QString>& groups) {
	_groups = groups;
}

void RosterItem::setAsk(const QString& ask) {
	_ask = ask;
}

void RosterItem::setSubscription(const SubscriptionState& subscription) {
	_subscription = subscription;
}

QList<RosterItem>& Roster::rosterItems() {
	return _rosterItems;
}

}
